{extend name='admin@main'}

{block name="button"}

{/block}

{block name="content"}

<div class="think-box-shadow">
    {include file='customer/customer/index_search'}
	<!--<div class="layui-tab layui-tab-card think-bg-white">
        <ul class="layui-tab-title notselect">
            <li data-type='' {if $Think.get.status eq 0} class="layui-this" {/if} data-open='{:url("")}?status=0&page=1'>全部</li>
            <li data-type="" {if $Think.get.status eq 1} class="layui-this" {/if} data-open='{:url("")}?status=1&page=1'>待审核<span class="layui-badge"></span></li>
            <li data-type="" {if $Think.get.status eq 2} class="layui-this" {/if} data-open='{:url("")}?status=2&page=1'>已审核</li>
        </ul>
    </div>-->
    <div class="layui-obj">
    	{if auth("admin/customer.customer/add")}
        <button data-open='{:url("add")}' data-title="添加客户" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
        {/if}
        <!--{if auth("admin/customer.customer/export")}
        <button data-title="导出" class='layui-btn layui-btn-sm layui-btn-primary' data-export-table="" data-export-url="{:url("export")}">导出</button>
        {/if}-->
    </div>
    <table class="layui-table margin-top-0" lay-skin="line" data-export-name='table'>
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class='text-left nowrap'>客户编号</th>
            <th class='text-left nowrap'>公司名称</th>
            <th class='text-left nowrap'>客户类型</th>
            <th class="text-left">国家</th>
            <th class="text-left">来源渠道</th>
            <th class="text-left">意向程度</th>
            <th class="text-left">跟进次数</th>
            <th class='text-center nowrap'>负责人</th>
            <th class="text-left">首触时间</th>
            <th class="text-left">最后跟进时间</th>
            <th class="text-left">创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'>
            </td>
            <td class='text-left nowrap'>{$vo.unique|default=''}</td>
            <td class='text-left nowrap'>{$vo.company_name|default=''}</td>
            <td class='text-left nowrap'>
                {$vo.country_cn|default=''}
            </td>
            <td class='text-left nowrap'>
                {$vo.post_type_cn|default=''}
            </td>
            <td class='text-left nowrap'>
                {$vo.source_type_cn|default=''}
            </td>
            <td class='text-left nowrap'>
                {$vo.intention_level_cn|default=''}
            </td>
            <td class='text-left nowrap'>
                {$vo.follow_num|default=''}
            </td>
            <td class='text-center nowrap'>
                {$vo.charger_cn|default=''}
            </td>            
            <td class='text-left nowrap'>
            	{$vo.first_contact_at|default=''}
            </td>           
            <td class='text-left nowrap'>
            	{$vo.last_follow_at|default=''}
            </td>      
            <td class='text-left nowrap'>日期：{$vo.create_at|format_datetime|str_replace=' ','<br><span class="color-desc">时间：',###|raw}</span></td>

            <td class='text-left nowrap'>            	
            	{if auth("admin/customer.customer/browse")}
                <a data-dbclick data-title="查看客户" class="layui-btn layui-btn-warm layui-btn-sm" data-open='{:url("browse")}?id={$vo.id}'>查 看</a>
                {/if}
                {if auth("admin/customer.customer/edit")}               	
                	<a data-dbclick data-title="编辑客户" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>               	
                {/if}
                 
                {if auth("admin/customer.customer/followList")}
                <a data-dbclick data-title="跟进记录" class="layui-btn layui-bg-blue layui-btn-sm" data-open='{:url("followList")}?id={$vo.id}'>跟进记录</a>
                {/if}
                
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}


</div>
<style>
    .layui-obj{
        margin-top: 10px!important;
    }
    .layui-tab{
        margin-top: 10px!important;
    }
	.layui-table td, .layui-table th {
		box-sizing: border-box;
	}
</style>
{/block}

